package com.im.util;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import com.im.ConstantToShare;

/**
 * 常量转换成js
 * @author yangwc
 *
 */
public class ConstToJScript {

	public String createScript() {
		StringBuffer buffer = new StringBuffer("");
		buffer.append("<script>\n");
		Set keys = ConstantToShare.mapToShare.keySet();
		for (Iterator iter = keys.iterator(); iter.hasNext();) {
			String key = (String) iter.next();
			buffer.append(key + "= '" + ConstantToShare.mapToShare.get(key) + "';\n");
		}
		buffer.append("</script> \n");
		return buffer.toString();
	}

	public static void main(String[] args) {
		ConstToJScript reader = new ConstToJScript();
	}
}
